package com.nd.controller.admin;

import com.nd.pojo.vo.BaseRespVo;
import com.nd.pojo.vo.StatOrderVO;
import com.nd.pojo.vo.StatUserVo;
import com.nd.service.StatFormService;
import com.nd.pojo.vo.StatGoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author : PengFei Zhang
 * @Data :2021/6/6  20:06
 * @Description :
 */
//统计报表  zpf
@RestController
@RequestMapping("admin")
public class StatFormController {
    @Autowired
    StatFormService statFormService;

    //用户统计
    @RequestMapping("stat/user")
    public BaseRespVo StatUser() {
        StatUserVo statUserVo = statFormService.selectStatUser();
        return BaseRespVo.ok(statUserVo);
    }
    //订单统计
    @RequestMapping("stat/order")
    public BaseRespVo statOrder() {
        StatOrderVO statOrder = statFormService.statOrder();
        return BaseRespVo.ok(statOrder);
    }


    //商品统计
    @RequestMapping("stat/goods")
    public BaseRespVo StatGoods() {
        StatGoodsVo statGoodsVo = statFormService.selectStatGoods();
        return BaseRespVo.ok( statGoodsVo);
    }

}
